<%-- 
    Document   : mostrarItemsCategoria
    Created on : 24/Jan/2012, 1:52:20
    Author     : sexta13
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>


<script type="text/javascript">
    <!--
    $(document).ready(function(){
	
        $("#markAsRead").click(function(){
            $.ajax({
                url: "MarkFeedAsReadAction.action?idItemFeed="+$(this).parent().parent().attr("id")+"&share=0",
                processData: false,
                dataType: "html",
                success: function(content) {
                    if(content === 'success') {
                        $(this).remoceClass("article_wrapper").addClass("article_wrapper_done");	
                    }
                }
            });
        });
	
        $("#shareFB").click(function(){
            $.ajax({
                url: "MarkFeedAsReadAction.action?idItemFeed="+$(this).parent().parent().attr("id")+"&share=1",
                processData: false,
                dataType: "html",
                success: function(content) {                    
                     
                     
                    if(content !='') {            		                        
                      $.modal("<div><h1>Partilhado com sucesso.</h1></div>",{minHeight : "100",
			minWidth:"200"});
                    }
                }
            });
        });
        
         $("#shareTwitter").click(function(){
            $.ajax({
                url: "MarkFeedAsReadAction.action?idItemFeed="+$(this).parent().parent().attr("id")+"&share=2",
                processData: false,
                dataType: "html",
                success: function(content) {                    
                     
                     
                    if(content !='') {            		                        
                      $.modal("<div><h1>Partilhado com sucesso.</h1></div>",{minHeight : "100",
			minWidth:"200"});
                    }
                }
            });
        });
	
	
    });

    //-->
</script>

<s:iterator value="listaItemFeeds" var="item">
    <div id="<s:property value="%{#item.id}"/>" class="article_wrapper">
        <h2><a href="<s:property value="%{#item.url}"/>"><s:property value="%{#item.titulo}"/></a></h2>
        <p><s:property escape="true" value="%{#item.descricao}"/></p>
       	<p>
            <s:checkbox name="markAsRead" id="markAsRead">Marcar como lida</s:checkbox>
                <img id="shareFB" alt="" src="http://static.viewbook.com/images/social_icons/facebook_16.png" />
                <img id="shareTwitter" alt="" src="http://static.viewbook.com/images/social_icons/twitter_16.png"/>
            </p> 
        </div>            
</s:iterator>